package com.pengtu.service.project.labs;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.pengtu.dao.Page;
import com.pengtu.dao.QueryFilter;
import com.pengtu.dao.project.labs.DetectcontractDao;
import com.pengtu.entity.project.labs.Detectcontract;

@Service
@Transactional
public class DetectcontractManager {
	@Autowired
	private DetectcontractDao detectcontractDao;

	// Detectcontract Manager //
	@Transactional(readOnly = true)
	public Detectcontract getDetectcontract(String propertyName, String value) {
		if (propertyName.equalsIgnoreCase("id"))
			return detectcontractDao.get(value);;
		return detectcontractDao.findUniqueBy(propertyName, value);
	}

	@Transactional(readOnly = true)
	public List<Detectcontract> getAllDetectcontract() {
		return detectcontractDao.getAll();
	}
	
	public void saveDetectcontract(Detectcontract detectcontract) {
		detectcontractDao.save(detectcontract);
	}

	public void deleteDetectcontract(String id) {
		detectcontractDao.delete(id);
	}

	@Transactional(readOnly = true)
	public Page<Detectcontract> findPageDetect(Page<Detectcontract> page,
			QueryFilter queryfilter) {
		return detectcontractDao.findPage(page, queryfilter);
	}
}

